package com.biz.user.designPattern.strategyPattern.demo;

import org.springframework.stereotype.*;

import javax.annotation.*;

@Component
public class PayHandlerDemo {

    @Resource
    private PayFactory payFactory;

    public void dealPay(int code) {
        PayHandler payHandler = payFactory.getHandlerByCode(code);
        payHandler.dealPay();
    }

}
